package com.zwj.controller;

import com.zwj.bo.AddDataDictionaryBo;
import com.zwj.dto.Result;
import com.zwj.entity.CourseInfoEntity;
import com.zwj.entity.DataDictionaryEntity;
import com.zwj.service.CourseUserService;
import com.zwj.service.DataDictionaryService;
import com.zwj.utils.TokenUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@Api(value = "数据字典",tags="数据字典")
@RestController
@RequestMapping("/data_dictionary")
public class DataDictionaryController {
    private final DataDictionaryService dataDictionaryService;
    public DataDictionaryController(DataDictionaryService dataDictionaryService){
        this.dataDictionaryService = dataDictionaryService;
    }
    @ApiOperation(value = "添加数据字典", notes = "添加数据字典")
    @PostMapping("/addDataDictionary")
    public Result addDataDictionary(@RequestBody AddDataDictionaryBo addDataDictionaryBo, HttpServletRequest httpServletRequest) {
        String userId = TokenUtils.getUserID(httpServletRequest);
        return dataDictionaryService.addDataDictionary(addDataDictionaryBo,userId);
    }

}
